package com.hyz.login.controller;


import com.alibaba.fastjson.JSON;
import com.hyz.login.model.Moneytype;
import com.hyz.login.service.MoneytypeService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zwq
 * @since 2022-11-29
 */
@Controller
public class MoneytypeController {

    @Autowired
    private MoneytypeService moneytypeService;

    Logger logger = LoggerFactory.getLogger(MoneytypeController.class);

    @PostMapping("/moneytype/all")
    @ResponseBody
    public String all(){
        logger.info("-----------------------------------------医保");
        return "{\"msg\":\"\",\"code\":0,\"data\":"+ JSON.toJSONString(moneytypeService.findAll())+"}";
    }

}

